package com.hanwuwen.demo.HelloQuartz;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

public class HelloJob implements Job {

  public void execute(JobExecutionContext arg0) throws JobExecutionException {
    //打印当前的执行时间，格式为 2018-01-01 00:00:00
    Date date = new Date();
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    System.out.println("当前执行时间：" + sdf.format(date));
    //编写具体的业务逻辑
    System.out.println("Hello Quartz!");
  }

}
